home *** CD-ROM | disk | FTP | other *** search
/ X User Tools / X User Tools (O'Reilly and Associates)(1994).ISO / sun4c / archive / tcltk.z / tcltk / man / cat3 / GetPixels.3 < prev    next >
Text File  |  1994-09-20  |  5KB  |  133 lines

  1.  
  2.  
  3.  
  4. Tk_GetPixels(3)       Tk Library Procedures
  5.  
  6.  
  7.  
  8. _________________________________________________________________
  9.  
  10. NAME
  11.      Tk_GetPixels, Tk_GetScreenMM - translate between strings and  |
  12.      screen units                                                  |
  13.  
  14. SYNOPSIS                                                           |
  15.      #include <tk.h>                                               |
  16.  
  17.      int                                                           |
  18.      Tk_GetPixels(_i_n_t_e_r_p, _t_k_w_i_n, _s_t_r_i_n_g, _i_n_t_P_t_r)                   |
  19.  
  20.      int                                                           |
  21.      Tk_GetScreenMM(_i_n_t_e_r_p, _t_k_w_i_n, _s_t_r_i_n_g, _d_o_u_b_l_e_P_t_r)              |
  22.  
  23. ARGUMENTS                                                          |
  24.      Tcl_Interp   *_i_n_t_e_r_p    (in)                                       ||
  25.                                        Interpreter   to  use  for  |
  26.                                        error reporting.            |
  27.  
  28.      Tk_Window    _t_k_w_i_n      (in)                                       ||
  29.                                        Window     whose    screen  |
  30.                                        geometry  determines   the  |
  31.                                        conversion  between  abso-  |
  32.                                        lute units and pixels.      |
  33.  
  34.      char         *_s_t_r_i_n_g    (in)                                       ||
  35.                                        String  that  specifies  a  |
  36.                                        distance on the screen.     |
  37.  
  38.      int          *_i_n_t_P_t_r    (out)                                      ||
  39.                                        Pointer   to  location  in  |
  40.                                        which to  store  converted  |
  41.                                        distance in pixels.         |
  42.  
  43.      double       *_d_o_u_b_l_e_P_t_r (out)                                      ||
  44.                                        Pointer   to  location  in  |
  45.                                        which to  store  converted  |
  46.                                        distance in millimeters.    |
  47. _________________________________________________________________  |
  48.  
  49.  
  50. DESCRIPTION                                                        |
  51.      These two procedures take as  argument  a  specification  of  |
  52.      distance  on the screen (_s_t_r_i_n_g) and compute the correspond-  |
  53.      ing distance either in integer pixels or floating-point mil-  |
  54.      limeters.   In  either  case, _s_t_r_i_n_g specifies a screen dis-  |
  55.      tance as a floating-point number followed by one of the fol-  |
  56.      lowing characters that indicates units:                       |
  57.  
  58.      <none>                                                             ||
  59.           The number specifies a distance in pixels.               |
  60.  
  61.  
  62.  
  63. Tk                                                              1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. Tk_GetPixels(3)       Tk Library Procedures
  71.  
  72.  
  73.  
  74.      c                                                                  ||
  75.           The  number  specifies a distance in centimeters on the  |
  76.           screen.                                                  |
  77.  
  78.      i                                                                  ||
  79.           The  number  specifies  a  distance  in  inches  on the  |
  80.           screen.                                                  |
  81.  
  82.      m                                                                  ||
  83.           The  number  specifies a distance in millimeters on the  |
  84.           screen.                                                  |
  85.  
  86.      p                                                                  ||
  87.           The  number  specifies  a  distance in printer's points  |
  88.           (1/72 inch) on the screen.                               |
  89.  
  90.      Tk_GetPixels converts _s_t_r_i_n_g to the nearest even  number  of  |
  91.      pixels  and  stores  that  value at *_i_n_t_P_t_r.  Tk_GetScreenMM  |
  92.      converts  _s_t_r_i_n_g  to  millimeters  and  stores  the  double-  |
  93.      precision floating-point result at *_d_o_u_b_l_e_P_t_r.                |
  94.  
  95.      Both procedures return TCL_OK  under  normal  circumstances.  |
  96.      If  an  error occurs (e.g. _s_t_r_i_n_g contains a number followed  |
  97.      by a character that  isn't  one  of  the  ones  above)  then  |
  98.      TCL_ERROR  is  returned  and  an  error  message  is left in  |
  99.      _i_n_t_e_r_p->_r_e_s_u_l_t.                                               |
  100.  
  101.  
  102. KEYWORDS                                                           |
  103.      centimeters, convert, inches, millimeters,  pixels,  points,  |
  104.      screen units
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Tk                                                              2
  130.  
  131.  
  132.  
  133.